class Vue{
  constructor(options){
    // 1. 通过属性保存选项的数据
    this.$option = options 
    this.$data = options.data || {}
    this.$el = typeof options.el === "string" ? document.querySelector(options.el) : options.el


    this._proxyData(this.$data)

    new ObServe(this.$data)

    new Compiler(this)
  }

  _proxyData(data){
    // console.log(Object.keys(data));
    Object.keys(data).forEach(key=>{
    
      Object.defineProperty(this,key,{
        enumerable:true,
        configurable:true,
        get(){
          return data[key]
        },
        set(newValue){
          if(data[key] === newValue){
            return
          }
          data[key] = newValue  
          
        }
      })
    })
  }


}